<#import "/common/function.ftl" as fn>
<@fn.header _title="">
<script type="text/javascript" src="${base}/resources/script/jquery.validate.js"></script>
<script type="text/javascript" src="${base}/resources/script/jquery.validate.methods.js"></script>
<script type="text/javascript" src="${base}/resources/script/date97/WdatePicker.js"></script>
<script type="text/javascript">
$(function() {
	var $validateErrorContainer = $("#validateErrorContainer");
	var $validateErrorLabelContainer = $("#validateErrorContainer ul");
	var $validateForm = $("#validateForm");
	
	// 表单验证
	$validateForm.validate({
		errorContainer: $validateErrorContainer,
		errorLabelContainer: $validateErrorLabelContainer,
		wrapper: "li",
		errorClass: "validateError",
		ignoreTitle: true,
		rules: {
			"name": "required",
			"fromDate": "required",
			"toDate": "required",
			"domicileLimit": "required",
			"avgArea": "required",
			"avgIncome": "required",
			"avgProperty": "required",
		},
		messages: {
			"name": "请填写标准名称",
			"fromDate": "请选择起始日期",
			"toDate": "请选择终止日期",
			"domicileLimit": "请选择是否有户籍要求",
			"avgArea": "请填写人均居住面积",
			"avgIncome": "请填写人均收入",
			"avgProperty": "请填写人均支配财产",
		},
		submitHandler: function(form) {
			$(form).find(":submit").attr("disabled", true);
			form.submit();
		}
	});	
});
function domicileLimitChange(val){
	if(val == "true"){
		$("#domicile").show();
	}else{
		$("#domicile").hide();
	}
}
</script>
</@fn.header>

<body style="width:100%" class="list">
<form id="validateForm" action="<#if isAddAction>save<#else>update</#if>" method="post">
	<h2><img src="${base}/resources/style/images/iconDivM.gif" width="16" height="16" />标准管理</h2>
	<div id="validateErrorContainer" class="validateErrorContainer marginTop15" style="display:none;">
		<div class="validateErrorTitle">以下信息填写有误,请重新填写</div>
		<ul></ul>
	</div>
	<div class="title marginTop15">
		<div class="title-middle">
			<div class="title-left"></div>
			<div class="title-caption"><#if isAddAction>添加标准<#else>编辑标准</#if></div>
            <div class="title-right"></div>
		</div>
	</div>
	<table class="table3" id="userListTable">
		<tr>
			<th>
				标准名称: 
			</th>
			<td>
				<input type="text" name="name" class="formText" value="" />
				<label class="requireField">*</label>
			</td>
		</tr>
		<tr>
			<th>
				起始日期: 
			</th>
			<td>
				<input type="text" name="fromDate" class="formText" onClick="WdatePicker()" value="" />
				<label class="requireField">*</label>
			</td>
		</tr>
		<tr>
			<th>
				终止日期: 
			</th>
			<td>
				<input type="text" name="toDate" class="formText" onClick="WdatePicker()" value="" />
				<label class="requireField">*</label>
			</td>
		</tr>
		<tr>
			<th>
				是否有户籍要求: 
			</th>
			<td>
				<select name="domicileLimit" onChange="domicileLimitChange(this.value);">
					<option value="">请选择</option>
					<option value="true">是</option>
					<option value="false">否</option>
				</select>
				<label class="requireField">*</label>
			</td>
		</tr>
		<tr id="domicile" style="display:none;">
			<th>
				户籍要求内容: 
			</th>
			<td>
				<input type="text" name="domicile" class="formText" value="" />
				<label class="requireField">*</label>
			</td>
		</tr>
		<tr>
			<th>
				人均居住面积: 
			</th>
			<td>
				<input type="text" name="avgArea" class="formText" value="" />
				<label class="requireField">*</label>
			</td>
		</tr>
		<tr>
			<th>
				人均月收入: 
			</th>
			<td id="parentId">
				<input type="text" name="avgIncome" class="formText" value="" />
				<label class="requireField">*</label>
			</td>
		</tr>
		<tr>
			<th>
				人均可支配财产: 
			</th>
			<td>
				<input type="text" name="avgProperty" class="formText" value="" />
				<label class="requireField">*</label>
			</td>
		</tr>
	</table>
	<input type="submit" class="button" value="确 定" />
	<input type="button" class="button" value="返 回" onclick="javascript:history.go(-1);" />
</form>
</body>
</html>